#include <STC89C5xRC.H>
#include "Timer0.h"

sbit LED = P2^0;
bit Flag = 0;
unsigned char Time,i;

void Delay(unsigned int t)
{
	while(t--);
}


void main()
{	
	Timer0Init();
	while(1)
	{		
		
	}
}

void Timer0_Routine() interrupt 1
{	

	TL0 = 0x66;
	TH0 = 0xFC;
	while(Time == 0 || Time == 100)
	{
		Flag = ~Flag;
	}
	if(Time <= 100 && Flag == 0)
	{
		LED=0;
		Delay(Time);
		LED=1;
		Delay(100-Time);
		Time++;
	}
	else if(Time >= 0 && Flag == 1)
	{
		LED=0;
		Delay(Time);
		LED=1;
		Delay(100-Time);
		Time--;
	}
}